package licode.unisop.platform.client.event;

import cn.hutool.json.JSONUtil;
import licode.unisop.provider.vo.SiAssetInfo;
import licode.unisop.types.event.DomainEvent;

/**
 * 资源增加事件
 *
 * @author licode
 */
public class AssetsAddedEvent extends DomainEvent {
    public AssetsAddedEvent(SiAssetInfo assetInfo) {
        super(SiAssetInfo.class.getTypeName(),
                JSONUtil.toJsonStr(assetInfo), "assets:add");
    }

    public SiAssetInfo getAssetInfo() {
        return JSONUtil.toBean(getData(), SiAssetInfo.class);
    }
}
